{% extends 'base.html' %}
{% load static %}

{% block title %}登录 - AI Prompt Hub{% endblock %}

{% block content %}
<div class="container">
    <div class="row justify-content-center mt-5">
        <div class="col-md-6 col-lg-4">
            <div class="card">
                <div class="card-header text-center">
                    <h4 class="mb-0">用户登录</h4>
                </div>
                <div class="card-body">
                    <form method="post">
                        {% csrf_token %}
                        {% if form.errors %}
                            <div class="alert alert-danger">
                                用户名或密码错误，请重试。
                            </div>
                        {% endif %}
                        <div class="mb-3">
                            <label for="id_username" class="form-label">用户名</label>
                            <input type="text" name="username" class="form-control" id="id_username" required>
                        </div>
                        <div class="mb-3">
                            <label for="id_password" class="form-label">密码</label>
                            <input type="password" name="password" class="form-control" id="id_password" required>
                        </div>
                        <div class="d-grid">
                            <button type="submit" class="btn btn-primary">登录</button>
                        </div>
                    </form>
                </div>
                <div class="card-footer text-center">
                    <small class="text-muted">
                        还没有账号？请联系管理员
                    </small>
                </div>
            </div>
        </div>
    </div>
</div>

<style>
    .card {
        background-color: var(--dark-secondary);
        border: 1px solid rgba(255,255,255,0.1);
    }
    
    .card-header {
        background-color: rgba(255,255,255,0.05);
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .card-footer {
        background-color: rgba(255,255,255,0.05);
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    
    .form-control {
        background-color: var(--dark-bg);
        border: 1px solid rgba(255,255,255,0.1);
        color: var(--text-primary);
    }
    
    .form-control:focus {
        background-color: var(--dark-bg);
        border-color: var(--accent-color);
        color: var(--text-primary);
        box-shadow: 0 0 0 0.2rem rgba(114, 137, 218, 0.25);
    }
    
    .form-label {
        color: var(--text-primary);
    }
    
    .btn-primary {
        background-color: var(--accent-color);
        border-color: var(--accent-color);
    }
    
    .btn-primary:hover {
        background-color: #5b6eae;
        border-color: #5b6eae;
    }
</style>
{% endblock %} 